All Questions
Tagged with programming-challengeinterview-questions
93 questions
4votes
1answer
186views
Last Stone Weight Problem in Haskell using list `insert`
Background Saw this problem on TheJobOverflow which seems to be a LeetCode question. It bothered me that the "challenge" of this problem was to recognize the need for a specific data-type (...
1vote
1answer
314views
Finding the winner of a tic-tac-toe game in Swift
Working on the problem Find Winner on a Tic Tac Toe Game, I took several hours longer than an artificial time constraint the site had for mock interview purposes. This leads me to wonder if my ...
2votes
3answers
1kviews
Find the 'n' most frequent words in a text, aka word frequency
I'm doing freeCodeCamp's Coding Interview Prep to improve my JavaScript skills. This challenge is called "Word Frequency", and is based on the Rosetta Code's entry of the same name. The ...
2votes
2answers
150views
LeetCode Reverse Nodes in k-Group
Link: https://leetcode.com/problems/reverse-nodes-in-k-group/ Problem description: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive ...
2votes
2answers
985views
InterviewBit Problem: Stringoholics
I am trying to solve this InterviewBit problem. Problem Statement: You are given an array A consisting of strings made up of the letters ‘a’ and ‘b’ only. Each string goes through a number of ...
2votes
0answers
628views
Cron expression parser
Problem Write a command line application or script which parses a cron string and expands each field to show the times at which it will run. ~$ your-program "*/15 0 1,15 * 1-5 /usr/bin/find"...
2votes
0answers
64views
Rainfall challenge: procedural implementation
This evening I have seen the text of the Rainfall Challenge posted seven years ago by Hunter McMillen. I did not look at his solution (besides, I have no clue about perl), but I was intrigued by the ...
4votes
1answer
97views
Graph: N Robots and M Nodes
I was recently told I need to change my coding style. An Interviewer told me he would like to see "more formalized class structure and organization". I have attached few of my cpp files. if ...
2votes
1answer
114views
Propagation in grid
Can I do it with a lower Big O / better code? How can I improve this solution? Task: Let's assume we have a array like this: 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 ...
8votes
1answer
844views
FizzBuzz in Csharp
For my first CodeReview, I would like to present my FizzBuzz solution in C#. My design has all of the rule logic about when to display what in separate classes through an interface. This design should ...
2votes
1answer
839views
LeetCode: Greatest Common Divisor of Strings C#
https://leetcode.com/problems/greatest-common-divisor-of-strings/ For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated with itself 1 or more times) Return ...
4votes
1answer
705views
LeetCode: Rotting Oranges in C#
https://leetcode.com/problems/rotting-oranges/ Please review for coding style in 40 minutes job interview. In a given grid, each cell can have one of three values: the value 0 representing an ...
4votes
1answer
1kviews
Jumping on the clouds
I have started the Hackerrank interview preparation kit. The first problem I have solved with Swift is as follows: Emma is playing a new mobile game that starts with consecutively numbered clouds. ...
3votes
2answers
706views
Calculate the largest palindromic number from the product of two 6-digit numbers (100000 to 999999)
Are there any efficient ways to solve this problem, for example using bitwise operator? ...
3votes
1answer
580views
Find the largest product of an array
This task is taken from www.interviewbit.com Given an array of integers, return the highest product possible by multiplying 3 numbers from the array Input: ...